<%--
  Created by IntelliJ IDEA.
  User: Stiofan
  Date: 2016/12/23
  Time: 8:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/common/tags.jsp" %>

<aos:html title="土地产权登记管理" base="http" lib="ext">
    <aos:body>
    </aos:body>
</aos:html>
<aos:onready>
    <aos:viewport layout="fit">
        <aos:formpanel layout="column" columnWidth="1" border="false" autoScroll="true">
            <aos:docked dock="top" columnWidth="1" layout="column" border="true" height="140">
                <aos:formpanel id="ryjcxxForm" layout="column" columnWidth="1">
                    <aos:fieldset title="人员基础信息" collapsible="false">
                        <aos:hiddenfield id="djxh" name="djxh"/>
                        <aos:textfield id="nsrsbh" name="nsrsbh" fieldLabel="纳税人识别号" columnWidth="0.25"
                                       onenterkey="queryRyjcxx" star="true" allowBlank="false"/>
                        <aos:hiddenfield id="shxydm" name="shxydm" fieldLabel="社会信用代码" columnWidth="0.25"
                                         onenterkey="queryRyjcxx"/>
                        <aos:hiddenfield id="zzjgdm" name="zzjgdm" fieldLabel="组织机构代码" columnWidth="0.25"
                                         onenterkey="queryRyjcxx"/>
                        <aos:textfield id="nsrmc" name="nsrmc" fieldLabel="纳税人名称" columnWidth="0.25" readOnly="true"/>
                        <aos:textfield id="lxrxm" name="lxrxm" fieldLabel="联系人姓名" columnWidth="0.25" readOnly="true"/>
                        <aos:combobox id="lxrsfzjlxDm" name="lxrsfzjlxDm" fieldLabel="证件类型" dicField="sfzjlxDm"
                                      columnWidth="0.25" dicFilter="201" readOnly="true"/>
                        <aos:textfield id="lxrsfzjhm" name="lxrsfzjhm" fieldLabel="证件号码" columnWidth="0.25"
                                       readOnly="true"/>
                        <aos:textfield id="lxrgddh" name="lxrgddh" fieldLabel="固定电话" columnWidth="0.25"
                                       readOnly="true"/>
                        <aos:textfield id="lxryddh" name="lxryddh" fieldLabel="移动电话" columnWidth="0.25"
                                       readOnly="true"/>
                        <aos:textfield id="lxrdz" name="lxrdz" fieldLabel="联系人地址" columnWidth="1" readOnly="true"/>
                    </aos:fieldset>
                </aos:formpanel>
            </aos:docked>
            <aos:gridpanel id="tdjcxxGrid" layout="fit" forceFit="true" url="tdsyqdjglService.queryTdsyqdjxxBydjxh"
                           hidePagebar="true" width="2000" autoScroll="true" features="summary">
                <aos:selmodel type="checkbox" mode="single"/>
                <aos:column header="土地产权UUID" dataIndex="tdsyquuid" align="center" hidden="true"/>
                <aos:column header="土地编号" dataIndex="tdbh" align="center" width="2"
                            summaryRenderer="function(){return '合计'}"/>
                <aos:column header="宗地地号" dataIndex="tdzdh" align="center" width="1"/>
                <aos:column header="坐落地址" dataIndex="zldz" width="3" align="center"/>
                <aos:column header="使用人类型" dataIndex="tdsyrlxDm" rendererField="tdsyrlxDm" align="center"
                            width="1"/>
                <aos:column header="使用权类型" dataIndex="tdsyqlxDm" rendererField="tdsyqlxDm" align="center"
                            width="1"/>
                <aos:column header="起始日期" dataIndex="tdsyqQsrq" align="center" width="1" type="date"
                            format="Y-m-d"/>
                <aos:column header="终止日期" dataIndex="tdsyqZzrq" align="center" width="1" type="date"
                            format="Y-m-d"/>
                <aos:column header="土地原值" dataIndex="tdzyz" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <aos:column header="土地面积" dataIndex="tdsyqYsmj" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <aos:column header="免税面积" dataIndex="tdsyqMsmj" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <aos:column header="应纳税额" dataIndex="tdsyqYsje" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <aos:column header="免税税额" dataIndex="tdsyqMsje" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <aos:column header="应缴税额" dataIndex="tdsyqYjse" align="right" width="1.2" type="number"
                            format="0.00" defaultValue="0" summaryType="sum"/>
                <%--<aos:column header="应税面积" dataIndex="tdsyqYsmj" align="right" width="1" type="number"--%>
                <%--format="0.00"/>--%>
                <%--<aos:column header="免税面积" dataIndex="tdsyqMsmj" align="right" width="1" type="number"--%>
                <%--format="0.00"/>--%>
            </aos:gridpanel>
            <aos:window id="tdsyqdjxxWin" title="土地使用权登记信息" width="1000" maxHeight="460">
                <aos:panel layout="column" autoScroll="true" columnWidth="1">
                    <aos:formpanel id="tdjcxxForm" layout="column" columnWidth="1">
                        <aos:fieldset title="土地基础信息" collapsible="false">
                            <aos:textfield id="tdbh" name="tdbh" fieldLabel="土地编号" columnWidth="0.5"
                                           onenterkey="queryTdjcxx" star="true" allowBlank="false"/>
                            <aos:textfield id="tdzmj" name="tdzmj" fieldLabel="土地面积(平米)" columnWidth="0.5"
                                           readOnly="true"/>
                            <aos:hiddenfield id="tdzynse" name="tdzynse" fieldLabel="土地总应纳税额" columnWidth="0.5"
                                           readOnly="true"/>
                            <aos:textfield id="zldz" name="zldz" fieldLabel="坐落地址" columnWidth="1" readOnly="true"/>
                            <aos:fieldset title="土地边界四至" collapsible="false">
                                <aos:textfield name="tdbjszD" fieldLabel="东" columnWidth="0.5" readOnly="true"/>
                                <aos:textfield name="tdbjszX" fieldLabel="西" columnWidth="0.5" readOnly="true"/>
                                <aos:textfield name="tdbjszN" fieldLabel="南" columnWidth="0.5" readOnly="true"/>
                                <aos:textfield name="tdbjszB" fieldLabel="北" columnWidth="0.5" readOnly="true"/>
                            </aos:fieldset>
                        </aos:fieldset>
                    </aos:formpanel>
                    <aos:formpanel id="tdsyqdjxxForm" layout="column" columnWidth="1">
                        <aos:fieldset title="土地使用权信息" collapsible="false">
                            <aos:hiddenfield id="tdsyquuid" name="tdsyquuid"/>
                            <aos:combobox id="tdsyrlxDm" name="tdsyrlxDm" dicField="tdsyrlxDm" fieldLabel="使用人类型"
                                          columnWidth="0.5" star="true" allowBlank="false"/>
                            <aos:combobox id="tdsyqlxDm" name="tdsyqlxDm" dicField="tdsyqlxDm" dicFilter="!03"
                                          fieldLabel="使用权类型"
                                          columnWidth="0.5" star="true" allowBlank="false"/>
                            <aos:textfield id="tdsyqZsbh" name="tdsyqZsbh" fieldLabel="使用权证书编号" columnWidth="0.5"/>
                            <aos:datefield id="tdsyqQdrq" name="tdsyqQdrq" fieldLabel="实际使用土地日期" columnWidth="0.5"
                                           star="true" allowBlank="false"/>
                            <aos:datefield id="tdsyqQsrq" name="tdsyqQsrq" fieldLabel="使用权起始日期" columnWidth="0.5"/>
                            <aos:datefield id="tdsyqZzrq" name="tdsyqZzrq" fieldLabel="使用权终止日期" columnWidth="0.5"/>
                            <aos:textfield id="tdsyqYsmj" name="tdsyqYsmj" fieldLabel="应税土地面积" columnWidth="0.5"
                                           regex="/^[0-9]+([.]{1}[0-9]{1,2})?$/" regexText="必输输入数字并且保留至多两位小数"
                                           msgTarget="under" star="true" allowBlank="false"/>
                            <aos:textfield id="tdsyqYsje" name="tdsyqYsje" fieldLabel="应纳税额" columnWidth="0.5"
                                           regex="/^[0-9]+([.]{1}[0-9]{1,2})?$/" regexText="必输输入数字并且保留至多两位小数"
                                           msgTarget="under" star="true" allowBlank="false"/>
                            <aos:textfield id="tdsyqMsmj" name="tdsyqMsmj" fieldLabel="免税土地面积" columnWidth="0.5"
                                           regex="/^[0-9]+([.]{1}[0-9]{1,2})?$/" regexText="必输输入数字并且保留至多两位小数"
                                           msgTarget="under" readOnly="true"/>
                            <aos:textfield id="tdsyqMsje" name="tdsyqMsje" fieldLabel="免税税额" columnWidth="0.5"
                                           regex="/^[0-9]+([.]{1}[0-9]{1,2})?$/" regexText="必输输入数字并且保留至多两位小数"
                                           msgTarget="under" readOnly="true"/>
                        </aos:fieldset>
                    </aos:formpanel>
                </aos:panel>
                <aos:docked dock="bottom" ui="footer" columnWidth="1">
                    <aos:dockeditem xtype="tbfill"/>
                    <aos:dockeditem id="btnSave" text="保存" onclick="saveTdsyqdjxx" icon="ok.png"/>
                    <aos:dockeditem id="btnDel" text="作废" onclick="#zfTdsyqdjxxWin.show();" icon="del.png"/>
                    <aos:dockeditem text="关闭" onclick="#tdsyqdjxxWin.close();" icon="close.png"/>
                </aos:docked>
            </aos:window>
            <aos:window id="zfTdsyqdjxxWin" title="作废土地使用权登记信息" width="1000" maxHeight="460">
                <aos:formpanel id="zfTdsyqdjxxForm" layout="column" autoScroll="true">
                    <aos:textareafield id="zfyy" name="zfyy" fieldLabel="作废原因" labelWidth="60" columnWidth="1"
                                       height="200"/>
                </aos:formpanel>
                <aos:docked dock="bottom" ui="footer">
                    <aos:dockeditem xtype="tbfill"/>
                    <aos:dockeditem text="作废" onclick="zfTdsysdjxxByTdsyquuid" icon="del.png"/>
                    <aos:dockeditem text="关闭" onclick="#zfTdsyqdjxxWin.close();" icon="close.png"/>
                </aos:docked>
            </aos:window>
            <aos:window id="tdsyqJmxxWin" layout="column" title="土地使用权减免信息" width="1000" maxHeight="460">
                <aos:gridpanel id="tdsyqJmxxGrid" forceFit="true"
                               url="tdsyqdjglService.queryTdsyqJmxxByTdsyquuid"
                               hidePagebar="true" columnWidth="1" height="420" features="summary">
                    <aos:selmodel type="checkbox" mode="single"/>
                    <aos:column header="土地等级明细UUID" dataIndex="tddjmxuuid" hidden="true"/>
                    <aos:column header="土地减免明细UUID" dataIndex="tdsyqjmuuid" hidden="true"/>
                    <aos:column header="土地编号" dataIndex="tdbh" hidden="true" summaryRenderer="function(){return '合计'}"/>
                    <aos:column header="土地等级" dataIndex="tddjDm" rendererField="tddjDm" align="center"/>
                    <aos:column header="税额代码" dataIndex="dwseDm" hidden="true"/>
                    <aos:column header="税额标准" dataIndex="sebz" align="center"/>
                    <aos:column header="土地面积" dataIndex="tdmj" format="0.00" type="number" defaultValue="0"
                                summaryType="sum"/>
                    <aos:column header="应纳税额" dataIndex="ynse" format="0.00" type="number" defaultValue="0"
                                summaryType="sum"/>
                    <aos:column header="减免性质" dataIndex="tdjmxzDm" rendererField="tdjmxzDm" align="center"/>
                    <aos:column header="减免面积" dataIndex="jmmj" format="0.00" type="number" defaultValue="0"
                                summaryType="sum"/>
                    <aos:column header="减免税额" dataIndex="jmse" format="0.00" type="number" defaultValue="0"
                                summaryType="sum"/>
                    <aos:column header="应缴税额" dataIndex="yjse" format="0.00" type="number" defaultValue="0"
                                summaryType="sum"/>
                    <aos:column header="有效期起" dataIndex="jmYxqq" format="Y-m-d" type="date" align="center"/>
                    <aos:column header="有效期止" dataIndex="jmYxqz" format="Y-m-d" type="date" align="center"/>
                </aos:gridpanel>
                <aos:docked dock="bottom" ui="footer">
                    <aos:dockeditem xtype="tbfill"/>
                    <aos:dockeditem text="修改" onclick="openTddjJmmxxxWin" icon="ok.png"/>
                    <aos:dockeditem text="关闭" onclick="#tdsyqJmxxWin.close();" icon="close.png"/>
                </aos:docked>
            </aos:window>
            <aos:window id="tddjJmmxxxWin" width="1000" maxHeight="460">
                <aos:formpanel id="tddjJmmxxxForm" layout="column" columnWidth="1">
                    <aos:fieldset title="土地等级减免明细信息" collapsible="false">
                        <aos:hiddenfield id="tddjmxuuid" name="tddjmxuuid"/>
                        <aos:hiddenfield id="tdsyqjmuuid" name="tdsyqjmuuid"/>
                        <aos:combobox id="tdjmxzDm" name="tdjmxzDm" fieldLabel="减免性质" dicField="tdjmxzDm"
                                      columnWidth="0.5" star="true" allowBlank="false"/>
                        <aos:textfield id="jmmj" name="jmmj" fieldLabel="减免面积" columnWidth="0.5"
                                       regex="/^[0-9]+([.]{1}[0-9]{1,2})?$/" regexText="必输输入数字并且保留至多两位小数"
                                       msgTarget="under" star="true" allowBlank="false"/>
                        <aos:datefield id="jmYxqq" name="jmYxqq" fieldLabel="有效期起" columnWidth="0.5" star="true"
                                       allowBlank="false"/>
                        <aos:datefield id="jmYxqz" name="jmYxqz" fieldLabel="有效期止" columnWidth="0.5" star="true"
                                       allowBlank="false"/>
                    </aos:fieldset>
                </aos:formpanel>
                <aos:docked dock="bottom" ui="footer">
                    <aos:dockeditem xtype="tbfill"/>
                    <aos:dockeditem text="保存" onclick="saveTddjJmmxxx" icon="ok.png"/>
                    <aos:dockeditem text="作废" onclick="#zfTddjjmxxWin.show();" icon="del.png"/>
                    <aos:dockeditem text="关闭" onclick="#tddjJmmxxxWin.close();" icon="close.png"/>
                </aos:docked>
            </aos:window>
            <aos:window id="zfTddjjmxxWin" title="作废土地等级减免信息" width="1000" maxHeight="460">
                <aos:formpanel id="zfTddjjmxxForm" layout="column" autoScroll="true">
                    <aos:textareafield id="zfyyJm" name="zfyyJm" fieldLabel="作废原因" labelWidth="60" columnWidth="1"
                                       height="200"/>
                    <aos:docked dock="bottom" ui="footer">
                        <aos:dockeditem xtype="tbfill"/>
                        <aos:dockeditem text="作废" onclick="zfTddjjmxxByTdsyqjmuuid" icon="del.png"/>
                        <aos:dockeditem text="关闭" onclick="#zfTddjjmxxWin.close();" icon="close.png"/>
                    </aos:docked>
                </aos:formpanel>
            </aos:window>
            <aos:docked dock="bottom" ui="footer" columnWidth="1" layout="column" border="false">
                <aos:panel layout="column" columnWidth="1" border="false">
                    <aos:panel layout="column" columnWidth="0.5" center="true" animate="false" border="false">
                        <aos:button center="true" id="btnAdd" text="新增" columnWidth="0.25" margin="2"
                                    onclick="addNewTdsyqdjxx"/>
                        <aos:button center="true" id="btnMod" text="修改" columnWidth="0.25" margin="2"
                                    onclick="modTdsyqdjxx"/>
                        <aos:button center="true" text="重置" columnWidth="0.25" margin="2"
                                    onclick="resetAllForms"/>
                        <aos:button center="true" text="减免" columnWidth="0.25" margin="2"
                                    onclick="openTdsyqjmxxWin"/>
                    </aos:panel>
                </aos:panel>
            </aos:docked>
        </aos:formpanel>
    </aos:viewport>

    <script type="text/javascript">
        function queryRyjcxx() {
            if (nsrsbh.getValue() === "") {
                AOS.err("必须输入纳税人识别号进行查询");
            } else {
                var params = {
                    nsrsbh: nsrsbh.getValue(),
                    shxydm: nsrsbh.getValue(),
                    zzjgdm: nsrsbh.getValue(),
                    djxh: djxh.getValue()
                };
                AOS.ajax({
                    params: params,
                    url: "tdsyqdjglService.queryRyjcxx",
                    ok: function (data) {
                        if (data.appcode === "noRyxx") {
                            Ext.getCmp("btnAdd").setDisabled(true);
                            Ext.getCmp("btnSave").setDisabled(true);
                            Ext.getCmp("btnDel").setDisabled(true);
                            AOS.err("未查询到相关信息，请先进行人员基础信息采集!");
                        } else {
                            Ext.getCmp("btnAdd").setDisabled(false);
                            Ext.getCmp("btnSave").setDisabled(false);
                            Ext.getCmp("btnDel").setDisabled(false);
                            AOS.setValues(ryjcxxForm, data);
                            AOS.read(nsrsbh);
                            AOS.read(shxydm);
                            AOS.read(zzjgdm);
                            var params = {
                                djxh: data.djxh
                            };
                            tdjcxxGrid_store.getProxy().extraParams = params;
                            tdjcxxGrid_store.reload();
                            if (tdjcxxGrid_store.getCount() === 0) {
                                AOS.tip("未查询到已经登记的土地信息，请点击新增按钮增加！");
                                AOS.read(tdbh);
                            } else {
                                AOS.edit(tdbh);
                            }
                            AOS.tip("根据人员信息查询到共" + tdjcxxGrid_store.getCount() + "土地登记信息，可以通过新增、修改、删除按钮进行更改！");
                            Ext.getCmp("btnAdd").setDisabled(false);
                            Ext.getCmp("btnMod").setDisabled(false);
                        }
                    }
                })
            }
        }
        function queryTdjcxx() {
            if (tdbh.getValue() === "") {
                AOS.err("必须输入土地编号进行查询");
            } else {
                var params = {
                    tdbh: tdbh.getValue()
                };
                AOS.ajax({
                    params: params,
                    url: "tdjcxxcjService.queryTdjcxxByTdbh",
                    ok: function (data) {
                        if (data.appcode === "suc") {
                            AOS.setValues(tdjcxxForm, data);
                            Ext.getCmp("tdsyqYsmj").setValue(Ext.getCmp("tdzmj").getValue());
                            Ext.getCmp("tdsyqYsje").setValue(Ext.getCmp("tdzynse").getValue());
                            AOS.read(tdbh);
                        } else {
                            AOS.err("未根据土地编号查询到相关信息，请确认土地编号是否输入有误!");
                            AOS.edit(tdbh);
                        }

                    }
                });
            }
        }
        function queryTdsyqdjxx() {
            var params = {
                djxh: Ext.getCmp("djxh").getValue(),
                tdbh: Ext.getCmp("tdbh").getValue(),
                tdsyquuid: tdsyquuid.getValue()
            };
            AOS.ajax({
                params: params,
                url: "tdsyqdjglService.queryTdsyqdjxxByTdsyquuid",
                ok: function (data) {
                    AOS.setValues(tdsyqdjxxForm, data);
                    if (data.tdsyqQsrq !== undefined && data.tdsyqQsrq !== "") {
                        AOS.setValue("tdsyqdjxxForm.tdsyqQsrq", Ext.Date.parse(data.tdsyqQsrq.substr(0, 10), 'Y-m-d', true));
                    }
                    if (data.tdsyqZzrq !== undefined && data.tdsyqZzrq !== "") {
                        AOS.setValue("tdsyqdjxxForm.tdsyqZzrq", Ext.Date.parse(data.tdsyqZzrq.substr(0, 10), 'Y-m-d', true));
                    }
                    if (data.tdsyqQdrq !== undefined && data.tdsyqQdrq !== "") {
                        AOS.setValue("tdsyqdjxxForm.tdsyqQdrq", Ext.Date.parse(data.tdsyqQdrq.substr(0, 10), 'Y-m-d', true));
                    }
                }
            });
        }
        function saveTdsyqdjxx() {
            if (AOS.valid(tdsyqdjxxForm)) {
                if (Ext.getCmp("tdsyqYsmj").getValue() === "") {
                    AOS.setValue("tdsyqYsmj", 0);
                }
                if (Ext.getCmp("tdsyqMsmj").getValue() === "") {
                    AOS.setValue("tdsyqMsmj", 0);
                }
                if (Ext.getCmp("tdsyqYsje").getValue() === "") {
                    AOS.setValue("tdsyqYsje", 0);
                }
                if (Ext.getCmp("tdsyqMsje").getValue() === "") {
                    AOS.setValue("tdsyqMsje", 0);
                }
                var params = {
                    djxh: Ext.getCmp("djxh").getValue(),
                    tdbh: Ext.getCmp("tdbh").getValue(),
                    tdzmj: Ext.getCmp("tdzmj").getValue()
                };
                AOS.ajax({
                    params: params,
                    forms: tdsyqdjxxForm,
                    url: "tdsyqdjglService.saveTdsyqdjxx",
                    ok: function (data) {
                        if (data.appcode === "suc") {
                            AOS.tip("土地产权信息保存成功！");
                            tdjcxxGrid_store.reload();
                            Ext.getCmp("btnSave").setDisabled(true);
                            Ext.getCmp("btnDel").setDisabled(true);
                        } else if (data.appcode === "err") {
                            AOS.err(data.appmsg);
                        }

                    }
                });
            } else {
                AOS.err("请检查相关信息是否输入完整！");
            }
        }
        function resetAllForms() {
            AOS.reset(ryjcxxForm);
            AOS.reset(tdjcxxForm);
            AOS.reset(tdsyqdjxxForm);
            AOS.edit(nsrsbh);
            AOS.edit(shxydm);
            AOS.edit(zzjgdm);
            AOS.edit(tdbh);
            Ext.getCmp("btnAdd").setDisabled(true);
            Ext.getCmp("btnSave").setDisabled(true);
            Ext.getCmp("btnDel").setDisabled(true);
            Ext.getCmp("btnMod").setDisabled(true);
            tdjcxxGrid_store.removeAll();
        }
        function modTdsyqdjxx() {
            var record = AOS.selectone(Ext.getCmp("tdjcxxGrid"));
            AOS.reset(tdjcxxForm);
            AOS.reset(tdsyqdjxxForm);
            AOS.setValue("tdjcxxForm.tdbh", record.data.tdbh);
            AOS.setValue("tdsyqdjxxForm.tdsyquuid", record.data.tdsyquuid);
            queryTdjcxx();
            queryTdsyqdjxx();
            Ext.getCmp("tdsyqdjxxWin").show();
            Ext.getCmp("btnSave").setDisabled(false);
            Ext.getCmp("btnDel").setDisabled(false);
        }
        function addNewTdsyqdjxx() {
            AOS.edit(tdbh);
            AOS.reset(tdjcxxForm);
            AOS.reset(tdsyqdjxxForm);
            Ext.getCmp("tdsyqdjxxWin").show();
        }
        function zfTdsysdjxxByTdsyquuid() {
            var record = AOS.selectone(Ext.getCmp("tdjcxxGrid"));
            var params = {
                tdsyquuid: record.data.tdsyquuid
            };
            AOS.ajax({
                params: params,
                forms: zfTdsyqdjxxForm,
                url: "tdsyqdjglService.zfTdsysdjxxByTdsyquuid",
                ok: function (data) {
                    if (data.appcode === "suc") {
                        zfTdsyqdjxxWin.close();
                        AOS.tip("土地使用权信息作废成功!");
                        tdjcxxGrid_store.reload();
                        Ext.getCmp("btnSave").setDisabled(false);
                        Ext.getCmp("btnDel").setDisabled(false);
                        AOS.reset(tdjcxxForm);
                        AOS.reset(tdsyqdjxxForm);
                    } else if (data.appcode === "err") {
                        AOS.err(data.appmsg);
                    }
                }
            });
        }
        function openTdsyqjmxxWin() {
            var record = AOS.selectone(Ext.getCmp("tdjcxxGrid"));
            var params = {
                tdbh: record.data.tdbh,
                tdsyquuid: record.data.tdsyquuid
            };
            tdsyqJmxxGrid_store.getProxy().extraParams = params;
            tdsyqJmxxGrid_store.reload();
            Ext.getCmp("tdsyquuid").setValue(record.data.tdsyquuid);
            Ext.getCmp("tdsyqJmxxWin").show();
        }
        function openTddjJmmxxxWin() {
            var record = AOS.selectone(Ext.getCmp("tdsyqJmxxGrid"));
            Ext.getCmp("tdjmxzDm").setValue(record.data.tdjmxzDm);
            Ext.getCmp("jmmj").setValue(record.data.jmmj);
            Ext.getCmp("jmYxqq").setValue(record.data.jmYxqq);
            Ext.getCmp("jmYxqz").setValue(record.data.jmYxqz);
            Ext.getCmp("tddjmxuuid").setValue(record.data.tddjmxuuid);
            Ext.getCmp("tdsyqjmuuid").setValue(record.data.tdsyqjmuuid);
            Ext.getCmp("tddjJmmxxxWin").show();
        }
        function saveTddjJmmxxx() {
            if (AOS.valid(tddjJmmxxxForm)) {
                var record = AOS.selectone(Ext.getCmp("tdsyqJmxxGrid"));
                if (record.data.tdmj < Ext.getCmp("jmmj").getValue()) {
                    AOS.err("减免面积不能大于当前土地等级土地面积!");
                    return;
                }
                var params = {
                    tdsyquuid: Ext.getCmp("tdsyquuid").getValue(),
                    jmse: Ext.getCmp("jmmj").getValue() * record.data.sebz
                };
                AOS.ajax({
                    params: params,
                    forms: tddjJmmxxxForm,
                    url: "tdsyqdjglService.saveTddjJmmxxx",
                    ok: function (data) {
                        if (data.appcode === "suc") {
                            AOS.tip("减免信息保存成功!");
                            AOS.setValues(tddjJmmxxxForm, data);
                            tdsyqJmxxGrid_store.reload();
                        } else {
                            AOS.err(data.appmsg);
                        }
                    }
                });
            } else {
                AOS.err("请检查相关信息是否输入完整！");
            }
        }
        function zfTddjjmxxByTdsyqjmuuid() {
            var params = {
                tdsyqjmuuid: Ext.getCmp("tdsyqjmuuid").getValue()
            };
            AOS.ajax({
                params: params,
                forms: zfTddjjmxxForm,
                url: "tdsyqdjglService.zfTddjjmxxByTdsyqjmuuid",
                ok: function (data) {
                    if (data.appcode === "suc") {
                        AOS.tip("土地等级减免信息作废成功!");
                        tdsyqJmxxGrid_store.reload();
                        Ext.getCmp("tddjJmmxxxWin").close();
                        Ext.getCmp("zfTddjjmxxWin").close();
                    } else {
                        AOS.err(data.appmsg);
                    }
                }
            });
        }
    </script>
    Ext.getCmp("btnAdd").setDisabled(true);
    Ext.getCmp("btnSave").setDisabled(true);
    Ext.getCmp("btnDel").setDisabled(true);
</aos:onready>
